import os

file_info = os.stat('file.txt')
print(f'size {file_info.st_size},uid {file_info.st_uid},mode {file_info.st_mode:x},mtime {file_info.st_mtime}')

#mode 普通文件开头是8，目录是4
"""
1b6
0001 1011 0110
"""
import time
from time import strftime
from time import gmtime,time  #方便运算和存储

t = gmtime(file_info.st_mtime)
print(f'{t.tm_year}---{t.tm_mon}---{t.tm_mday}--{t.tm_hour}:{t.tm_min}:{t.tm_sec}  {t.tm_wday}')
print(strftime('%Y-%m-%d %H:%M:%S',gmtime(file_info.st_mtime)))


#距离1970年1月1号的描述
now = time()
print(now)
t = gmtime(now)
print(strftime('%Y-%m-%d %H:%M:%S',t))






